/*
 * 英才汇硕信息科技有限公司 拥有本软件版权 2023 并保留所有权利。
 * Copyright 2022, YCHS Information&Science Technology Co.,Ltd,
 * All rights reserved.
 */
package com.along.lawyermanage.dongao.service;

import com.along.lawyermanage.dongao.entity.Lawyer;
import com.along.lawyermanage.dongao.mapper.LawyerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 律师业务接口实现类
 * @author LiulongBing
 * @version 1.0
 */

@Service
public class LawyerServiceImpl implements LawyerService {

    @Autowired
    LawyerMapper lawyerMapper;
    /**
     * 添加律师
     * @param lawyer 律师对象
     * @return 成功返回1，否则返回0
     */
    @Override
    public int addLaywer(Lawyer lawyer) {
        return lawyerMapper.insertLawyer(lawyer);
    }

    /**
     * 查询所有律师
     * @return 返回律师的一个集合
     */
    @Override
    public List<Lawyer> findLawyer() {
        return lawyerMapper.selectLawyer();
    }

    /**
     * 按照指定编号删除律师信息
     * @param lawyerId 律师编号
     * @return 返回1 则删除成功：否则删除失败
     */
    @Override
    public int removeLawyer(int lawyerId) {
        return lawyerMapper.delLawyer(lawyerId);
    }


}
